
<%@ page language="java" contentType="text/html; charset=GBK"%>
<jsp:directive.page import="com.database.DataBase"/>
<jsp:directive.page import="com.sql.ReportFormSql"/>

<html>
  <head>
    <title>VipCardAddSubmit.jsp</title>
  </head>
  <body>
  <%
        String sign=request.getParameter("sign");
        System.out.println("sign:"+sign);
        String vipID=request.getParameter("VipID");
        int CardLength=Integer.parseInt(request.getParameter("CardLength"));
        int CardVerifyStart=Integer.parseInt(request.getParameter("CardVerifyStart"));
        int CardVerifyEnd=Integer.parseInt(request.getParameter("CardVerifyEnd"));
        String CardVerifyData=new String(request.getParameter("CardVerifyData").toString().getBytes("ISO8859_1"));
        DataBase base=new DataBase();
        ReportFormSql report=new ReportFormSql();
        String sql="";
        if(sign.equals("1")){
           sql=report.InsertVipCard(vipID,CardLength,CardVerifyStart,CardVerifyEnd,CardVerifyData);
         }
         else if(sign.equals("2")){
           int oid=Integer.parseInt(request.getParameter("ID"));
           sql=report.UpdateVipcard(vipID,CardLength,CardVerifyStart,CardVerifyEnd,CardVerifyData,oid);
        }
        System.out.println("xxxxxxx:"+sql);
        base.executeUpdate(sql);
        base.closeStmt();
        base.closeConn();
        response.sendRedirect("Vipcard.jsp");
  %>
  </body>
</html>
